Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose AppName header #848

Merged
merged 2 commits into from
Feb 7, 2024
Merged

Conversation

sebasslash
Copy link
Contributor

Description

This is a helper method that can be used to populate output that describes the instance you're currently running against. Rather than relying on client.IsCloud() (or IsEnterprise) checks, we can directly embed the app name value: "Terraform Cloud", "Terraform Enterprise".

So example output can look like:

fmt.Sprintf("%s is currently executing run with id: %s", client.AppName(), "foo-bar")

instead of:

if client.IsCloud() {
  fmt.Println("Terraform Cloud is currently executing run with id foo-bar")
} else {
  fmt.Println("Terraform Enterprise is currently executing run with id foo-bar")
}

@sebasslash sebasslash requested a review from a team as a code owner February 5, 2024 21:43
Copy link
Contributor

@laurenolivia laurenolivia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sebasslash sebasslash merged commit 7e3754a into main Feb 7, 2024
11 checks passed
@sebasslash sebasslash deleted the sebasslash/tf-12695_expose-appname-header branch February 7, 2024 18:06
Copy link

github-actions bot commented Feb 7, 2024

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

laurenolivia added a commit that referenced this pull request Feb 15, 2024
laurenolivia added a commit that referenced this pull request Feb 15, 2024
laurenolivia added a commit that referenced this pull request Feb 15, 2024
* add changelog entries for #847 and #848
Copy link

@moshahin01 moshahin01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great

Copy link

@moshahin01 moshahin01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

Copy link

@moshahin01 moshahin01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants